/**
 * Demonstrates a range of Button options the framework offers out of the box
 */
Ext.define('cloud.view.videos.Videos', {
    extend: 'Ext.navigation.View',
    xtype: 'videos',
    config: {
        defaultBackButtonText:'返回',
        items: [
            {
                xtype: 'container',
                layout: 'hbox',
                title: '景区视频',
                items: [
                    {
                        xtype: 'toolbar',
                        ui: 'dark',
                        docked: 'top',
                        items: [
                            {xtype: 'spacer'}
                        ]
                    },
                    {
                        xtype: 'list',
                        flex: 1,
                        store: 'VideosStore',
                        pressedCls:false,
                        selectedCls:false,
                        cls:'x-list2',
                        emptyText: '还未添加',
                        itemTpl: ['' +
                            '<div class="listName">{title}  </div>'
                        ].join(''),
                        listeners:{
                            initialize: function(){
                                 Ext.getStore('VideosStore').load();
                            }
                        },
                        plugins: [
                            {
                                xclass: 'Ext.plugin.PullRefresh',
                                pullRefreshText: '下拉可以更新',
                                releaseRefreshText: '松开开始更新',
                                style:'top:12px',
                                loadingText: '正在刷新……',
                                refreshFn: function (loaded, arguments) {
                                     loaded.getList().getStore().loadPage(1, {
                                        callback: function (record, operation, success) {
                                            Ext.Viewport.unmask();
                                        }, scope: this });
                                }
                            },
                            {
                                xclass: 'Ext.plugin.ListPaging',
                                loadMoreText: '<h2 style="text-align: center; padding-top: 20px; padding-bottom: 20px;">点击加载更多。。。。</h2>',
                                noMoreRecordsText: '<h2 style="text-align: center; padding-top: 20px; padding-bottom: 20px;">没有更多条记录了</h2>',
                                autoPaging: false //设置为TRUE将自动触发
                            }
                        ]
                    },
                    {
                        xtype: 'toolbar',
                        docked: 'bottom',
                        layout: {
                            type: 'hbox',
                            pack: 'center'
                        },
                        items: [
                            {
                                xtype: 'button',
                                id: 'videos_add',
                                cls:'x-button2',
                                iconMask: true,
                                text:'添加'
                            }
                        ]
                    }
                ]
            }
        ]
    }
});